package com.zy.project2_aop_base.jdkproxy;

/**
 * @program: mavenTest153
 * @description:
 * @author: zy
 * @create: 2025-07-15 11:54
 */
public class TestJdkProxy {
    public static void main(String[] args) {

        System.setProperty("jdk.proxy.ProxyGenerator.saveGeneratedFiles","true");   //jdk8以后的

        OrderBiz target=new OrderBizImpl();

        //通过 InvocationHandler类来创建代理类的对象
        MyAdviceInvocationHandler handler=new MyAdviceInvocationHandler(target);
        OrderBiz proxy= (OrderBiz) handler.getProxy();    //生成代理对象

        System.out.println(   proxy.toString() );  // proxy.toString()

        proxy.showOrder();

    }
}

// cglib代理 的实现
// cglib与jdk动态代理的区别.
// 事务管理机制.
